/**
 * 虚拟路由，通用 hack，Ajax header setting
 */
$(function() {
	// 默认视图
	var defaultView = '/weixin/publicinfo/list'; 
		//'/static/halfox/html/dash.index.html';
						
	
	window.preview_window_status = 'height=800, width=450, top=0, left=0,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no';
	
	// ajax header
	$.ajaxSetup({
		headers: {'Content-Type': 'application/json;charset=UTF-8'}
	});
	
	// 切换菜单
	$('.menu-item, #my-info').click(function() {
		$('.nav-list .active').removeClass('active');
		$('#bc-title').text($.trim(this.innerText));
		$(this).addClass('active');
	});
	// 渲染视图
	window.renderView = function(viewUrl){
		location.href = viewUrl;
	}
	// 渲染默认视图
	// renderView(defaultView);

	window.refreshView = function(){
		renderView(sessionStorage.getItem('view_url'));
	};

	$('#halfox_frame').attr('height', ($(document).height() - 115) + 'px');

});